package com.bjsxt.struts2.ognl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.opensymphony.xwork2.ActionSupport;

public class MyOgnlAction extends ActionSupport{


	private String username;
	private MyUser myuser;
	private String password;
	private MyCat mycat;
	private List<MyUser> myUsers = new ArrayList<MyUser>();


	private Set<MyDog> myDogs = new HashSet<MyDog>();
	private Map<String,MyDog> myDogsMap = new HashMap<String,MyDog>();
	
	public MyOgnlAction() {
		
		myUsers.add(new MyUser(1));
		myUsers.add(new MyUser(2));
		myUsers.add(new MyUser(3));
		
		myDogs.add(new MyDog("a"));
		myDogs.add(new MyDog("b"));
		myDogs.add(new MyDog("c"));
		
		myDogsMap.put("dog1", new MyDog("x"));
		myDogsMap.put("dog2", new MyDog("y"));
		myDogsMap.put("dog3", new MyDog("z"));
		
	}
	
	public String m(){
		return "hello";
	}
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String execute(){
		return SUCCESS;
	}

	public void setMyuser(MyUser myuser) {
		this.myuser = myuser;
	}

	public MyUser getMyuser() {
		return myuser;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPassword() {
		return password;
	}

	public void setMycat(MyCat mycat) {
		this.mycat = mycat;
	}

	public MyCat getMycat() {
		return mycat;
	}

	public void setMyDogsMap(Map<String,MyDog> myDogsMap) {
		this.myDogsMap = myDogsMap;
	}

	public Map<String,MyDog> getMyDogsMap() {
		return myDogsMap;
	}

	public void setMyDogs(Set<MyDog> myDogs) {
		this.myDogs = myDogs;
	}

	public Set<MyDog> getMyDogs() {
		return myDogs;
	}
	public List<MyUser> getMyUsers() {
		return myUsers;
	}

	public void setMyUsers(List<MyUser> myUsers) {
		this.myUsers = myUsers;
	}


}
